<template>
  <div class="project">
    <el-form
      :model="basicForm"
      label-position="top"
      :rules="basicRules"
      ref="basicFormRef"
    >
      <!-- 基本信息 -->
      <div class="project-part">
        <div class="project-part-title project-part-title1">
          基本信息
        </div>
        <div class="project-part-content">
          <el-row :gutter="24">
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目名称"
                prop="projectName"
              >
                <el-input
                  v-model="basicForm.projectName"
                  :disabled="isDetail"
                  @change="handleChangeProjectName"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目编号"
                prop="projectNo"
              >
                <el-input
                  v-model="basicForm.projectNo"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="政府投资项目"
                prop="governProject"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.governProject"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目年度"
                prop="filterYear"
              >
                <el-date-picker
                  value-format="yyyy"
                  type="years"
                  v-model="basicForm.filterYear"
                  placeholder=""
                  @change="handleChangeTime"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否PPP项目"
                prop="docProject"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.docProject"
                  clearable
                  :disabled="isDetail || !isGovernProject"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="“六个一批”"
                prop="policySixOne"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.policySixOne"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in policySixOneOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="功能区"
                prop="functionPart"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.functionPart"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in functionPartOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item label="乡镇街道" prop="area">
                <el-select
                  placeholder=""
                  v-model="basicForm.area"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in areaOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item label="详细地址" prop="address">
                <el-input
                  v-model="basicForm.address"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目位置经纬度"
                prop="location"
              >
                <el-input
                  v-model="basicForm.location"
                  :disabled="isDetail"
                ></el-input>
                <i
                  class="el-icon-location"
                  @click="handleShowMap"
                ></i>
              </el-form-item>
            </el-col>
            <!-- <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="审批文件"
                prop="approveFileName"
              >
                <UploadVue
                  class="file-upload"
                  v-model="basicForm.approveFileList"
                  :disabled="isDetail || !isGovernProject"
                  :showFileList="false"
                  :showProgress="true"
                />
                <el-input
                  placeholder="暂无文件"
                  v-model="basicForm.approveFileName"
                  :disabled="isDetail"
                  clearable
                ></el-input>
              </el-form-item>
            </el-col> -->
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="审批文件"
                prop="approveFileContent"
              >
                <el-input
                  placeholder=""
                  v-model="basicForm.approveFileContent"
                  :disabled="isDetail || !isGovernProject"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="审批主体"
                prop="approveMain"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.approveMain"
                  clearable
                  :disabled="isDetail || !isGovernProject"
                >
                  <el-option
                    v-for="item in approveMainOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="“三个做优做强”重点片区"
                prop="policyImportant"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.policyImportant"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in policyImportantOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="“三个做优做强”功能细分"
                prop="policyBetter"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.policyBetter"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in policyBetterOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item label="批次" prop="batch">
                <el-select
                  placeholder=""
                  v-model="basicForm.batch"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in batchOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="三个层次"
                prop="threeLayer"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.threeLayer"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in threeLayerOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="计划开工时间"
                prop="startTime"
              >
                <el-date-picker
                  v-model="basicForm.startTime"
                  type="month"
                  :disabled="isDetail"
                  value-format="yyyy-MM"
                  :picker-options="pickerStartOptions"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="计划竣工时间"
                prop="endTime"
              >
                <el-date-picker
                  v-model="basicForm.endTime"
                  type="month"
                  :disabled="isDetail"
                  value-format="yyyy-MM"
                  :picker-options="pickerEndOptions"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="战略性项目分类"
                prop="strategyProjectType"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.strategyProjectType"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in strategyProjectTypeOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="制造业分类"
                prop="manufacturingType"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.manufacturingType"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in manufacturingTypeOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="产业载体和创新平台(仅产业化项目填写)"
                prop="carrier"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.carrier"
                  clearable
                  :disabled="isDetail || isProjectType"
                >
                  <el-option
                    v-for="item in carrierOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="四个结构调整"
                prop="structure"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.structure"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in structureOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="建圈强链(仅产业化项目填写)"
                prop="industrialChain"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.industrialChain"
                  clearable
                  :disabled="isDetail || isProjectType"
                >
                  <el-option
                    v-for="item in industrialChainOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="实施时序"
                prop="workNode"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.workNode"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in workNodeOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="总投资"
                prop="investment"
              >
                <el-input
                  v-model="basicForm.investment"
                  :disabled="isDetail"
                  @change="handleChangeInvestment"
                  ><template slot="append"
                    >万元</template
                  ></el-input
                >
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="建设用地面积"
                prop="buildArea"
              >
                <el-input
                  v-model="basicForm.buildArea"
                  :disabled="isDetail"
                  ><template slot="append"
                    >亩</template
                  ></el-input
                >
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目类型"
                prop="projectType"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.projectType"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in projectTypeOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否建设项目(仅产业化项目填写)"
                prop="buildProject"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.buildProject"
                  clearable
                  :disabled="isDetail || isProjectType"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="所属片区开发"
                prop="ownDevelop"
              >
                <el-input
                  v-model="basicForm.ownDevelop"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="幸福美好生活十大工程"
                prop="happinessWork"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.happinessWork"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in happinessWorkOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否需要供地"
                prop="supportLand"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.supportLand"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="土地拟供应时间"
                prop="supportTime"
              >
                <el-date-picker
                  v-model="basicForm.supportTime"
                  type="date"
                  :disabled="isDetail || !isHasSupportLand"
                  value-format="yyyy-MM-dd HH:mm:ss"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目分类"
                prop="projectClassify"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.projectClassify"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in projectClassifyOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="投资合作协议签订时间"
                prop="investmentCooperationTime"
              >
                <el-date-picker
                  v-model="
                    basicForm.investmentCooperationTime
                  "
                  type="date"
                  :disabled="isDetail || isGovernProject"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目公司注册时间"
                prop="companyRegisterTime"
              >
                <el-date-picker
                  v-model="basicForm.companyRegisterTime"
                  type="date"
                  :disabled="isDetail || isGovernProject"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="国土出让合同签订时间"
                prop="landCooperationTime"
              >
                <el-date-picker
                  v-model="basicForm.landCooperationTime"
                  type="date"
                  :disabled="isDetail || isGovernProject"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="建设内容及规模"
                prop="content"
              >
                <el-input
                  placeholder="根据项目行业分类，要求增加填报项目建筑面积、产能、里程等对应信息"
                  v-model="basicForm.content"
                  :disabled="isDetail"
                  type="textarea"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <!-- 资金来源 -->
      <div class="project-part">
        <div class="project-part-title project-part-title1">
          资金来源
        </div>
        <div class="project-part-content">
          <el-row :gutter="24">
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="区财政"
                prop="zoneFinance"
              >
                <el-input
                  v-model="basicForm.zoneFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="街道财政"
                prop="streetFinance"
              >
                <el-input
                  v-model="basicForm.streetFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="上级资金"
                prop="parentFinance"
              >
                <el-input
                  v-model="basicForm.parentFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="其他融资"
                prop="otherMixFinance"
              >
                <el-input
                  v-model="basicForm.otherMixFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="BOT资金"
                prop="botFinance"
              >
                <el-input
                  v-model="basicForm.botFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="PPT资金"
                prop="docFinance"
              >
                <el-input
                  v-model="basicForm.docFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item label="贷款" prop="loans">
                <el-input
                  v-model="basicForm.loans"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item label="融建" prop="mixFinance">
                <el-input
                  v-model="basicForm.mixFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="其他资金"
                prop="otherFinance"
              >
                <el-input
                  v-model="basicForm.otherFinance"
                  :disabled="isDetail || !isGovernProject"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <!-- 申请上级资金情况 -->
      <div class="project-part">
        <div class="project-part-title project-part-title1">
          申请上级资金情况
        </div>
        <div class="project-part-content">
          <el-row :gutter="24">
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否申请专项债"
                prop="hasApplySpecial"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.hasApplySpecial"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="专项债金额"
                prop="specialAmount"
              >
                <el-input
                  v-model="basicForm.specialAmount"
                  :disabled="isDetail || !isHasApplySpecial"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否申请中央预算内资金"
                prop="hasApplyBudget"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.hasApplyBudget"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="中央预算内金额"
                prop="centerBudget"
              >
                <el-input
                  v-model="basicForm.centerBudget"
                  :disabled="isDetail || !isHasApplyBudget"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否申请政策性开发性金融工具"
                prop="hasApplyFinance"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.hasApplyFinance"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="政策性开发性金融工具金额"
                prop="policyFinanceAmount"
              >
                <el-input
                  v-model="basicForm.policyFinanceAmount"
                  :disabled="isDetail || !isHasApplyFinance"
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="是否申请其他上级资金"
                prop="hasApplySuperior"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.hasApplySuperior"
                  clearable
                  :disabled="isDetail"
                >
                  <el-option
                    v-for="item in ynOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="其他上级资金金额"
                prop="otherParentAmount"
              >
                <el-input
                  v-model="basicForm.otherParentAmount"
                  :disabled="
                    isDetail || !isHasApplySuperior
                  "
                  ><template slot="append">万元</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="其他上级资金名称"
                prop="otherParentName"
              >
                <el-input
                  v-model="basicForm.otherParentName"
                  :disabled="
                    isDetail || !isHasApplySuperior
                  "
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <!-- 责任信息 -->
      <div class="project-part">
        <div class="project-part-title project-part-title1">
          责任信息
        </div>
        <div class="project-part-content">
          <el-row :gutter="24">
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="业主（建设单位）"
                prop="buildUnit"
              >
                <el-input
                  v-model="basicForm.buildUnit"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="业主联系人"
                prop="contact"
              >
                <el-input
                  v-model="basicForm.contact"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="业主联系人电话"
                prop="phone"
              >
                <el-input
                  v-model="basicForm.phone"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="业主说明"
                prop="introduce"
              >
                <el-input
                  v-model="basicForm.introduce"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="报送单位"
                prop="reportUnit"
              >
                <el-input
                  v-model="basicForm.reportUnit"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="报送联系人"
                prop="reportContact"
              >
                <el-input
                  v-model="basicForm.reportContact"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="报送联系人电话"
                prop="reportPhone"
              >
                <el-input
                  v-model="basicForm.reportPhone"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="牵头责任部门"
                prop="departId"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.departId"
                  clearable
                  :disabled="isDetail"
                  multiple
                >
                  <el-option
                    v-for="item in departOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="牵头联系人"
                prop="leadContact"
              >
                <el-input
                  v-model="basicForm.leadContact"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="牵头联系人电话"
                prop="leadPhone"
              >
                <el-input
                  v-model="basicForm.leadPhone"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="分管领导"
                prop="branchLeader"
              >
                <el-input
                  v-model="basicForm.branchLeader"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="局领导"
                prop="adminLeader"
              >
                <el-input
                  v-model="basicForm.adminLeader"
                  :disabled="isDetail"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="24" :md="12" :lg="8" :xl="6">
              <el-form-item
                label="项目查阅用户"
                prop="permissionUser"
              >
                <el-select
                  placeholder=""
                  v-model="basicForm.permissionUser"
                  clearable
                  :disabled="isDetail"
                  multiple
                >
                  <el-option
                    v-for="item in departOptions"
                    :key="item.dictValue"
                    :label="item.dictText"
                    :value="item.dictValue"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-form>
    <customizeDialog
      :visible="dialogMapVisible"
      @update:visible="dialogMapVisible = $event"
      ref="dialog"
      :title="`${headerTitle}`"
      :width="'1200px'"
      top="100px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :has-footer="false"
      customPadding="0px"
    >
      <div
        v-loading="loading"
        element-loading-text="文件正在解析中，请稍后..."
      >
        <MapView
          :viewer-id="viewerId"
          :key="countMapLoad"
          @onload="onMapLoad"
        />
        <Utool
          :viewerId="viewerId"
          :position="{ top: '60px', right: '20px' }"
          :t="[]"
          :b="[
            {
              title: '初始位置',
              icon: 'dingwei'
            }
          ]"
          :showMore="false"
        ></Utool>
      </div>
      <div class="operate" v-if="!isDetail">
        <el-button
          @click="handleSureCoordinate"
          class="save-btn"
          >确定</el-button
        >
        <el-button
          @click="handleCancleCoordinate"
          class="cancle-btn"
          >取消</el-button
        >
      </div>
    </customizeDialog>
  </div>
</template>
<script>
import { getDictOptions } from '@/utils/dict'
// import UploadVue from '@/components/upload'
import MapView from '@/components/mapView'
import Utool from '@/components/utool/index-land'
import customizeDialog from '@/components/checkHistory/customizeDialog.vue'
import cacheUtil from '@/utils/cache'
import { homePosition } from '@/utils/constant'

let _layerManager, _viewer
const mapViewer = {}

export default {
  props: {
    isDetail: Boolean,
    detailInfo: Object
  },
  components: {
    MapView,
    Utool,
    customizeDialog
    // UploadVue
  },
  data() {
    return {
      basicForm: {
        pkid: '',
        projectName: '',
        projectNo: '',
        filterYear: [],
        governProject: '',
        docProject: '',
        policySixOne: '',
        area: '',
        address: '',
        location: '',
        policyBetter: '',
        approveMain: '',
        batch: '',
        threeLayer: '',
        startTime: '',
        endTime: '',
        strategyProjectType: '',
        manufacturingType: '',
        carrier: '',
        structure: '',
        industrialChain: '',
        workNode: '',
        // approveFileId: '',
        // approveFileName: '',
        // approveFileList: [],
        investment: '',
        buildArea: '',
        projectType: '',
        buildProject: '',
        ownDevelop: '',
        happinessWork: '',
        supportLand: '',
        supportTime: '',
        projectClassify: '',
        investmentCooperationTime: '',
        companyRegisterTime: '',
        landCooperationTime: '',
        content: '',
        zoneFinance: '',
        streetFinance: '',
        parentFinance: '',
        otherMixFinance: '',
        botFinance: '',
        docFinance: '',
        loans: '',
        mixFinance: '',
        otherFinance: '',
        specialAmount: '',
        centerBudget: '',
        policyFinanceAmount: '',
        otherParentAmount: '',
        otherParentName: '',
        buildUnit: '',
        contact: '',
        phone: '',
        introduce: '',
        reportUnit: '',
        reportContact: '',
        reportPhone: '',
        departId: [],
        leadContact: '',
        leadPhone: '',
        branchLeader: '',
        adminLeader: '',
        permissionUser: [],
        functionPart: '',
        approveFileContent: '',
        policyImportant: '',
        hasApplySpecial: '',
        hasApplyBudget: '',
        hasApplyFinance: '',
        hasApplySuperior: ''
      },
      basicRules: {
        projectNo: [
          {
            required: true,
            message: '请输入项目编号',
            trigger: 'blur'
          }
        ],
        projectName: [
          {
            required: true,
            message: '请输入项目名称',
            trigger: 'blur'
          }
        ],
        filterYear: [
          {
            required: true,
            message: '请选择项目年度',
            trigger: 'blur'
          }
        ],
        governProject: [
          {
            required: true,
            message: '请选择政府投资项目',
            trigger: 'blur'
          }
        ],
        area: [
          {
            required: true,
            message: '请选择乡镇街道',
            trigger: 'blur'
          }
        ],
        address: [
          {
            required: true,
            message: '请输入详情地址',
            trigger: 'blur'
          }
        ],
        // batch: [
        //   {
        //     required: true,
        //     message: '请选择批次',
        //     trigger: 'blur'
        //   }
        // ],
        startTime: [
          {
            required: true,
            message: '请选择计划开工时间',
            trigger: 'blur'
          }
        ],
        endTime: [
          {
            required: true,
            message: '请选择计划竣工时间',
            trigger: 'blur'
          }
        ],
        investment: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        buildArea: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        zoneFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        streetFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        parentFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        otherMixFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        botFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        docFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        loans: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        mixFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        otherFinance: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        specialAmount: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        centerBudget: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        policyFinanceAmount: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        otherParentAmount: [
          {
            pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
            message: '请输入最多两位小数的正数',
            trigger: 'blur'
          }
        ],
        phone: [
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: '请输入正确手机号码',
            trigger: 'blur'
          }
        ],
        reportPhone: [
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: '请输入正确手机号码',
            trigger: 'blur'
          }
        ],
        leadPhone: [
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: '请输入正确手机号码',
            trigger: 'blur'
          }
        ]
      },
      policySixOneOptions: [],
      areaOptions: [],
      approveMainOptions: [],
      policyBetterOptions: [],
      batchOptions: [],
      threeLayerOptions: [],
      strategyProjectTypeOptions: [],
      manufacturingTypeOptions: [],
      structureOptions: [],
      carrierOptions: [],
      industrialChainOptions: [],
      workNodeOptions: [],
      projectTypeOptions: [],
      happinessWorkOptions: [],
      projectClassifyOptions: [],
      departOptions: [],
      functionPartOptions: [],
      policyImportantOptions: [],
      ynOptions: [
        {
          dictValue: '是',
          dictText: '是'
        },
        {
          dictValue: '否',
          dictText: '否'
        }
      ],
      isGovernProject: false,
      isProjectType: false,
      isHasApplySpecial: false,
      isHasApplyBudget: false,
      isHasApplyFinance: false,
      isHasApplySuperior: false,
      isHasSupportLand: false,
      // 选择的生效日期时间
      pickerStartOptions: {
        disabledDate: (time) => {
          if (this.basicForm.endTime) {
            return (
              time.getTime() >
              new Date(this.basicForm.endTime).getTime()
            )
          } else {
            return false
          }
        }
      },
      // 选择的失效日期时间
      pickerEndOptions: {
        disabledDate: (time) => {
          if (this.basicForm.startTime) {
            return (
              time.getTime() <
              new Date(this.basicForm.startTime).getTime()
            )
          } else {
            return false
          }
        }
      },
      dialogMapVisible: false,
      viewerId: 'dwgMap',
      countMapLoad: 0,
      headerTitle: '项目位置',
      loading: false,
      cameraConfig: null,
      billboards: []
    }
  },
  computed: {
    titles() {
      return [this.title]
    }
  },
  mounted() {
    this.initOptions()
  },
  watch: {
    detailInfo(val) {
      if (val.pkid) {
        this.basicForm = Object.assign(
          this.basicForm,
          this.detailInfo
        )
        this.$set(
          this.basicForm,
          'filterYear',
          val.filterYear
        )
      }
    },
    // 政府投资项目：是 => 显示：是否PPP项目、审批文件、审批主体、资金情况模块
    // 政府投资项目：否 => 显示：投资合作协议签订时间、项目公司注册时间、国土出让合同签订时间
    'basicForm.governProject': function (val) {
      this.$refs.basicFormRef.clearValidate()
      if (val === '是') {
        this.isGovernProject = true
        this.basicForm.investmentCooperationTime = ''
        this.basicForm.companyRegisterTime = ''
        this.basicForm.landCooperationTime = ''
      } else {
        this.isGovernProject = false
        this.basicForm.docProject = ''
        // this.basicForm.approveFileId = ''
        // this.basicForm.approveFileName = ''
        // this.basicForm.approveFileList = []
        this.basicForm.approveFileContent = ''
        this.basicForm.approveMain = ''
        this.zoneFinance = ''
        this.streetFinance = ''
        this.parentFinance = ''
        this.otherMixFinance = ''
        this.botFinance = ''
        this.docFinance = ''
        this.loans = ''
        this.mixFinance = ''
        this.otherFinance = ''
      }
    },
    // 项目类型：产业化项目 => 可填写：产业载体和创新平台、建圈强链、是否建设项目
    // 'basicForm.projectType': function (val) {
    //   if (val === 'cyh') {
    //     this.isProjectType = false
    //   } else {
    //     this.isProjectType = true
    //     this.basicForm.carrier = ''
    //     this.basicForm.industrialChain = ''
    //     this.basicForm.buildProject = ''
    //   }
    // },
    // 是否申请专项债：是 => 可填写：专项债金额
    // 是否申请专项债：否 => 不可填写：专项债金额
    'basicForm.hasApplySpecial': function (val) {
      if (val === '是') {
        this.isHasApplySpecial = true
      } else {
        this.isHasApplySpecial = false
        this.basicForm.specialAmount = ''
      }
    },
    // 是否申请中央预算内资金：是 => 可填写：中央预算内资金
    // 是否申请中央预算内资金：否 => 不可填写：中央预算内资金
    'basicForm.hasApplyBudget': function (val) {
      if (val === '是') {
        this.isHasApplyBudget = true
      } else {
        this.isHasApplyBudget = false
        this.basicForm.centerBudget = ''
      }
    },
    // 是否申请政策性开发性金融工具：是 => 可填写：政策性开发性金融工具
    // 是否申请政策性开发性金融工具：否 => 不可填写：政策性开发性金融工具
    'basicForm.hasApplyFinance': function (val) {
      if (val === '是') {
        this.isHasApplyFinance = true
      } else {
        this.isHasApplyFinance = false
        this.basicForm.policyFinanceAmount = ''
      }
    },
    // 是否申请其他上级资金：是 => 可填写：其他上级资金金额、其他上级资金名称
    // 是否申请其他上级资金：否 => 不可填写：其他上级资金金额、其他上级资金名称
    'basicForm.hasApplySuperior': function (val) {
      if (val === '是') {
        this.isHasApplySuperior = true
      } else {
        this.isHasApplySuperior = false
        this.basicForm.otherParentAmount = ''
        this.basicForm.otherParentName = ''
      }
    },
    // 是否需要供地：是 => 填写：土地拟供应时间
    // 是否需要供地：否 => 不可填写：土地拟供应时间
    'basicForm.supportLand': function (val) {
      if (val === '是') {
        this.isHasSupportLand = true
      } else {
        this.isHasSupportLand = false
        this.basicForm.supportTime = ''
      }
    }
    // // 审批文件：上传
    // 'basicForm.approveFileList': function (val) {
    //   if (val && val.length > 0) {
    //     this.basicForm.approveFileId =
    //       val[val.length - 1].response.data
    //     this.basicForm.approveFileName =
    //       val[val.length - 1].name
    //   }
    // },
    // // 审批文件：删除
    // 'basicForm.approveFileName': function (val) {
    //   if (!val) {
    //     this.basicForm.approveFileId = ''
    //     this.basicForm.approveFileList = []
    //   }
    // }
  },
  methods: {
    async initOptions() {
      const data = await getDictOptions(
        'zhcy_lgyp,zhcy_gnq,zhcy_xzjd,zhcy_spzt,zhcy_zyzq_gnxf,zhcy_pc,zhcy_cc,zhcy_zlx,zhcy_zzy,zhcy_jgtz,zhcy_jqql,zhcy_cyzt_cxpt,zhcy_sssx,zhcy_xmlx,zhcy_xfmh,zhcy_xmfl,zhcy_qtbm,zhcy_qzd_gnq,zhcy_qzd_zyzqzdpq'
      )
      this.policySixOneOptions = data.filter(
        (i) => i.dictCode === 'zhcy_lgyp'
      )[0].resourceDictItems
      this.policyBetterOptions = data.filter(
        (i) => i.dictCode === 'zhcy_zyzq_gnxf'
      )[0].resourceDictItems
      this.areaOptions = data.filter(
        (i) => i.dictCode === 'zhcy_xzjd'
      )[0].resourceDictItems
      this.approveMainOptions = data.filter(
        (i) => i.dictCode === 'zhcy_spzt'
      )[0].resourceDictItems
      this.batchOptions = data.filter(
        (i) => i.dictCode === 'zhcy_pc'
      )[0].resourceDictItems
      this.threeLayerOptions = data.filter(
        (i) => i.dictCode === 'zhcy_cc'
      )[0].resourceDictItems
      this.strategyProjectTypeOptions = data.filter(
        (i) => i.dictCode === 'zhcy_zlx'
      )[0].resourceDictItems
      this.manufacturingTypeOptions = data.filter(
        (i) => i.dictCode === 'zhcy_zzy'
      )[0].resourceDictItems
      this.structureOptions = data.filter(
        (i) => i.dictCode === 'zhcy_jgtz'
      )[0].resourceDictItems
      this.carrierOptions = data.filter(
        (i) => i.dictCode === 'zhcy_cyzt_cxpt'
      )[0].resourceDictItems
      this.industrialChainOptions = data.filter(
        (i) => i.dictCode === 'zhcy_jqql'
      )[0].resourceDictItems
      this.workNodeOptions = data.filter(
        (i) => i.dictCode === 'zhcy_sssx'
      )[0].resourceDictItems
      this.projectTypeOptions = data.filter(
        (i) => i.dictCode === 'zhcy_xmlx'
      )[0].resourceDictItems
      this.happinessWorkOptions = data.filter(
        (i) => i.dictCode === 'zhcy_xfmh'
      )[0].resourceDictItems
      this.projectClassifyOptions = data.filter(
        (i) => i.dictCode === 'zhcy_xmfl'
      )[0].resourceDictItems
      this.departOptions = data.filter(
        (i) => i.dictCode === 'zhcy_qtbm'
      )[0].resourceDictItems
      this.functionPartOptions = data.filter(
        (i) => i.dictCode === 'zhcy_qzd_gnq'
      )[0].resourceDictItems
      this.policyImportantOptions = data.filter(
        (i) => i.dictCode === 'zhcy_qzd_zyzqzdpq'
      )[0].resourceDictItems
    },
    handleChangeTime(val) {
      this.$emit('changeTime', val)
    },
    onMapLoad({ id, viewer }) {
      _viewer = viewer
      mapViewer[this.viewerId] = viewer

      _viewer.scene.imageryLayers.addImageryProvider(
        new Cesium.TiandituImageryProvider({
          mapStyle: null,
          token: 'a49a9220798216424e34b531cb3fa5b2',
          url: 'https://t0.tianditu.gov.cn/img_w/wmts'
        }),
        0
      )

      this.billboards = mapViewer[
        this.viewerId
      ].scene.primitives.add(
        new Cesium.BillboardCollection()
      )
      mapViewer[
        this.viewerId
      ].screenSpaceEventHandler.setInputAction(
        this.leftClick,
        Cesium.ScreenSpaceEventType.LEFT_CLICK
      )
      this.setViewer(viewer)
      if (this.basicForm.location) {
        this.billboards.add({
          id: 'location-point',
          width: 18,
          height: 18,
          position: Cesium.Cartesian3.fromDegrees(
            Number(this.basicForm.location.split(',')[0]),
            Number(this.basicForm.location.split(',')[1]),
            0
          ),
          image: require('@/assets/img/location.png'),
          verticalOrigin: Cesium.VerticalOrigin.BOTTOM
        })
      }
    },
    leftClick(movement) {
      if (this.isDetail) {
        return
      }
      const cartesian = mapViewer[
        this.viewerId
      ].camera.pickEllipsoid(movement.position)
      const cartographic =
        Cesium.Cartographic.fromCartesian(cartesian)
      const lng = Cesium.Math.toDegrees(
        cartographic.longitude
      ) // 经度
      const lat = Cesium.Math.toDegrees(
        cartographic.latitude
      ) // 纬度

      this.billboards && this.billboards.removeAll()
      this.billboards.add({
        id: 'location-point',
        width: 18,
        height: 18,
        position: Cesium.Cartesian3.fromDegrees(
          lng,
          lat,
          0
        ),
        image: require('@/assets/img/location.png'),
        verticalOrigin: Cesium.VerticalOrigin.BOTTOM
      })
      this.newLocation = `${lng},${lat}`
    },
    // 打开弹窗
    handleShowMap() {
      this.dialogMapVisible = true
    },
    // 取消定位
    handleCancleCoordinate() {
      this.billboards && this.billboards.removeAll()
      this.dialogMapVisible = false
    },
    // 确定定位
    handleSureCoordinate() {
      this.basicForm.location = this.newLocation
      this.dialogMapVisible = false
    },
    // 设置视角
    setViewer(viewer) {
      const cacheItem = cacheUtil.getItem('camera')
      if (cacheItem) {
        try {
          const config = JSON.parse(cacheItem)
          if (config.cameraHeight && config.centerPoint) {
            this.cameraConfig = config
          } else {
            this.cameraConfig = null
          }
        } catch (e) {
          console.error(e)
          this.cameraConfig = null
        }
      } else {
        this.cameraConfig = null
      }
      if (this.basicForm.location) {
        viewer.camera.flyTo({
          destination: this.cameraConfig
            ? Cesium.Cartesian3.fromDegrees(
                Number(
                  this.basicForm.location.split(',')[0]
                ),
                Number(
                  this.basicForm.location.split(',')[1]
                ),
                Number(this.cameraConfig.cameraHeight)
              )
            : homePosition.destination,
          orientation: homePosition.orientation
        })
      } else {
        viewer.camera.flyTo({
          destination: this.cameraConfig
            ? Cesium.Cartesian3.fromDegrees(
                Number(
                  this.cameraConfig.centerPoint.split(
                    ','
                  )[0]
                ),
                Number(
                  this.cameraConfig.centerPoint.split(
                    ','
                  )[1]
                ),
                Number(this.cameraConfig.cameraHeight)
              )
            : homePosition.destination,
          orientation: homePosition.orientation
        })
      }
      viewer.scene.screenSpaceCameraController.enableCollisionDetection = true
      viewer.scene.globe.globeAlpha = 1
    },

    // 修改项目名称
    handleChangeProjectName(val) {
      this.$emit('changeProjectName', val)
    },

    // 修改总投资
    handleChangeInvestment(val) {
      this.$emit('changeInvestment', val)
    }
  },
  beforeDestroy() {
    if (this.billboards && this.billboards.length > 0) {
      this.billboards.removeAll()
    }
    if (this.viewerId && mapViewer[this.viewerId]) {
      mapViewer[
        this.viewerId
      ].screenSpaceEventHandler.removeInputAction(
        Cesium.ScreenSpaceEventType.LEFT_CLICK
      )
      mapViewer[this.viewerId] = null
    }
  }
}
</script>
<style lang="scss" scoped>
@import '~@/assets/css/form.scss';
::v-deep {
  .file-upload {
    .el-upload {
      position: absolute;
      left: 240px;
      top: -35px;
    }
  }
  .el-icon-location {
    position: absolute;
    top: 6px;
    left: 295px;
    color: #00baff;
    font-size: 25px;
    cursor: pointer;
  }
  .el-dialog {
    .el-dialog__body {
      .content {
        padding: 0;
      }
    }
    .cesium-viewer {
      height: 520px !important;
    }
  }
}
.operate {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  ::v-deep {
    .save-btn {
      background: #497fa3;
      border: 1px solid #497fa3;
      color: white;
      font-size: 14px;
      width: 80px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 0px;
    }
    .cancle-btn {
      font-size: 14px;
      width: 80px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #497fa3;
      color: #497fa3;
    }
  }
}
</style>
